import 'package:flutter/cupertino.dart';

/// @description:
/// @author tangzhentao
/// @created at 10:28 2024/11/30

class XfgPersistentHeaderDelegate extends SliverPersistentHeaderDelegate {
  final double maxHeight;
  final double minHeight;
  final Widget child;

  XfgPersistentHeaderDelegate({
    required this.child,
    required this.maxHeight,
    required this.minHeight
  });

  @override
  Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
    return child;
  }

  @override
  double get maxExtent => maxHeight;

  @override
  double get minExtent => minHeight;

  @override
  bool shouldRebuild(covariant XfgPersistentHeaderDelegate oldDelegate) => this != oldDelegate;
}
